package JAVA300.第七章数组;

public class TestInnerClass {
    public static void main(String[] args) {//测试内部类
       // InnerClass.Outer outer = new InnerClass.Outer();
        Outer.Inner inner = new Outer().new Inner();//内部类对象依托于外部类对象
        inner.show();
    }
}
class Outer{
    private int age =10;
    class Inner{
        int age = 20;
        public void show(){
            int age = 30;
            System.out.println("外部类属性"+Outer.this.age);
            System.out.println("内部类属性"+this.age);
            System.out.println("局部属性"+age);

        }
    }

}
